2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.Graphics;
9 namespace SuperPolarity
17 ParticleEngine particleEngine;
19 public override void Initialize(ContentManager Content, Texture2D texture, Vector2 position)
21 base.Initialize(Content, texture, position);
27 List<Texture2D> texturesList = new List<Texture2D>();
28 texturesList.Add(Content.Load<Texture2D>("Graphics\\circle"));
29 texturesList.Add(Content.Load<Texture2D>("Graphics\\diamond"));
30 texturesList.Add(Content.Load<Texture2D>("Graphics\\star"));
32 particleEngine = new ParticleEngine(texturesList, Position);
39 InputController.Bind("moveX", HandleHorizontalMovement);
40 InputController.Bind("moveY", HandleVerticalMovement);
43 public void HandleHorizontalMovement(float value)
45 Acceleration.X = value * AccelerationRate;
48 public void HandleVerticalMovement(float value)
50 Acceleration.Y = value * AccelerationRate;
53 public override void Update(GameTime gameTime)
55 base.Update(gameTime);
56 particleEngine.EmitterLocation = Position;
57 particleEngine.Update();
60 public override void Draw(SpriteBatch spriteBatch)
62 particleEngine.Draw(spriteBatch);
63 base.Draw(spriteBatch);